var path = require('path');
var fs = require('mz/fs');
var mime = require('mime');

var fn_index = async (ctx, next) => {
    "use strict";
    var fp = path.join(__dirname, '../index.html');
    if (await fs.exists(fp)) {
        // 查找文件的mime:
        ctx.response.type = 'text/html';
        // 读取文件内容并赋值给response.body:
        console.log('存在');
        ctx.response.body = await fs.readFile(fp);
    } else {
        // 文件不存在:
        console.log('不存在');
        ctx.response.status = 404;
    }
};

var fn_signin = async (ctx, next) => {
    "use strict";
}

module.exports = {
    'POST /api/signin': fn_signin
};